#pragma GCC optimize(2)
#include <iostream>
#include <queue>
#include <map>
#include <unordered_map>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstring>
#include <set>
#include <unordered_set>
#include <bitset>
#define IOS ios::sync_with_stdio(false), cin.tie(0), cout.tie(0)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
const int N=2e5+10;
int a[N];
void solve()
{
	int n;
	cin>>n;
	vector<int> b,c;
	for(int i=1;i<=n;i++) cin>>a[i];
	sort(a+1,a+1+n);
	if(a[n]!=a[1])
	{
		for(int i=1;i<=n;i++)
		{
			if(a[i]<a[n]) b.push_back(a[i]);
			else c.push_back(a[i]);

		}
		cout<<b.size()<<' '<<c.size()<<endl;;
		for(auto it:b) cout<<it<<' ';
		cout<<endl;

		for(auto it:c) cout<<it<<' ';
		cout<<endl;
	}
	else cout<<-1<<endl;
}
int main()
{
	IOS;
	int __t=1;
	cin>>__t;

	while(__t--)
	{
		solve();
	}

	return 0;
}

